package com.dk.service.impl;

import com.dk.mapper.OrderMapper;
import com.dk.pojo.TbOrder;
import com.dk.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceimpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<TbOrder> getAll() {
        return orderMapper.selectList(null);
    }

    @Override
    public TbOrder getById(Long id) {
        return orderMapper.selectById(id);
    }

    @Override
    public void addOrder(TbOrder order) {
        orderMapper.insert(order);
    }

    @Override
    public void deleteOrder(Long id) {
        orderMapper.deleteById(id);
    }

    @Override
    public void updateOrder(TbOrder order) {
        orderMapper.updateById(order);
    }
}
